import {request} from '@/utils/axios'
import service from '@/utils/request'

export const fetchData = () => {
    return service({
        url: './table.json',
        method: 'get'
    });
};

export class UserApi {
    static async updateUserPassword(params: {}) {
        return request('/api/parking/user/update', params, 'post')
    }

    static async getCaptcha(params: {}) {
        return request('/api/parking/getCapture', params, 'post', false)
    }

    static async userLogin(params: {}) {
        return request('/api/parking/login', params, 'post')
    }

    static async userLogout(params: {}) {
        return request('/User/logout', params, 'post')
    }

    static async getUserList(params: {}) {
        return request('/api/parking/user/list', params, 'post')
    }

    static async addUserInfo(params: {}) {
        return request('/api/parking/user/add', params, 'post')
    }

    static async deleteUserItem(params: {}) {
        return request('/api/parking/user/delete', params, 'post')
    }

    static async updateUserItem(params: {}) {
        return request('/api/parking/user/update', params, 'post')
    }

    static async checkUserInfo(params: {}) {
        return request('/api/parking/user/check', params, 'post')
    }
}

export class ParkingMgt {
    static async getProjectItemList(params: {}) {
        return request('/api/parking/community/list', params, 'post')
    }

    static async addProjectItem(params: {}) {
        return request('/api/parking/community/save', params, 'post')
    }

    static async updateProjectItem(params: {}) {
        return request('/api/parking/community/update', params, 'post')
    }

    static async deleteProjectItem(params: {}) {
        return request('/api/parking/community/delete', params, 'post')
    }

    //车辆管理
    static async getParkingCarList(params: {}) {
        return request('/api/parking/car/list', params, 'post')
    }

    static async addParkingCar(params: {}) {
        return request('/api/parking/car/insert', params, 'post')
    }

    static async batchAddParkingCar(params: {}) {
        return request('/api/parking/car/batchInsert', params, 'post')
    }

    static async updateParkingCar(params: {}) {
        return request('/api/parking/car/update', params, 'post')
    }

    static async deleteParkingCar(params: {}) {
        return request('/api/parking/car/delete', params, 'post')
    }

    static async exportParkingCar(params: {}) {
        return request('/api/parking/car/export', params, 'post')
    }


    // 车道管理
    static async getParkingLaneList(params: {}) {
        return request('/api/parking/parkingLane/list', params, 'post')
    }

    static async addParkingLine(params: {}) {
        return request('/api/parking/parkingLane/insert', params, 'post')
    }

    static async updateParkingLine(params: {}) {
        return request('/api/parking/parkingLane/update', params, 'post')
    }

    static async deleteParkingLine(params: {}) {
        return request('/api/parking/parkingLane/delete', params, 'post')
    }

    //车场管理
    static async getParkingItemList(params: {}) {
        return request('/api/parking/list', params, 'post')
    }

    static async batchAddParkingItem(params: {}) {
        return request('/api/parking/batchUpdateParking', params, 'post')
    }

    static async addParkingItem(params: {}) {
        return request('/api/parking/insertParking', params, 'post')
    }

    static async updateParkingItem(params: {}) {
        return request('/api/parking/parkingLotUpdate', params, 'post')
    }

    static async deleteParkingItem(params: {}) {
        return request('/api/parking/batchDeleteParking', params, 'post')
    }

    static async getCartList(params: {}) {
        return request('/api/parking/list', params, 'post')
    }
}

